package org.testfire.support;

import java.io.File;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: granum
 * Date: Sep 2, 2007
 * Time: 6:18:13 PM
 *
 */
public class FileUtils
{
    public static StringBuilder readFile( File file){
        StringBuilder buf= new StringBuilder();
        try
        {
            BufferedReader in = new BufferedReader( new java.io.FileReader(file));
            String line;
            while((line = in.readLine()) != null){
                buf.append( line).append( "\n" );
            }
        }
        catch ( FileNotFoundException e )
        {
            e.printStackTrace();
        }
        catch ( IOException e )
        {
            e.printStackTrace();
        }

        return buf;
    }
}
